package com.kjtpay.design_pattern.singleton;

/**
 * 饿汉式单例类
 */
class EagerSingleton {
    //类加载时就初始化
    private static final EagerSingleton ourInstance = new EagerSingleton();

    static EagerSingleton getInstance() {
        return ourInstance;
    }

    // 防止new操作
    private EagerSingleton() {
    }
}
